home *** CD-ROM | disk | FTP | other *** search
-
- #include <tos.h>
-
- void *Alphabase(void);
-
- /* #define Alphabase() _pxv(2001) */
-
- #define trap_3_w(n) \
- __extension__ \
- ({ \
- register long retvalue __asm__("d0"); \
- \
- __asm__ volatile \
- ("\
- movw %1,sp@-; \
- trap #3; \
- addqw #2,sp " \
- : "=r"(retvalue) /* outputs */ \
- : "g"(n) /* inputs */ \
- : "d0", "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
- AND_MEMORY \
- ); \
- retvalue; \
- })
-
- #define Alphabase() (void *)trap_3_w((short)(0x7D1))
-
- typedef char gp1k[1024];
- typedef unsigned short uint;
- typedef unsigned long ulong;
-
- struct alpha
- {
- void *afd_malloc; /* Apex Malloc routine (in) */
- void *afd_dealloc; /* Apex Mfree routine (in) */
- void *afd_salloc; /* Apex stacked malloc routine */
- void *afd_thread; /* Apex background thread (in) */
- void *afd_open; /* Fopen (in) */
- void *afd_close; /* Fclose (in) */
- void *afd_create; /* Fcreate (in) */
- void *afd_read; /* Fread (in) */
- void *afd_write; /* Fwrite (in) */
- void *afd_seek; /* Fseek (in) */
- void *afd_examine; /* Fseek + Fread (in) */
- void *afd_patch; /* Fseek + Fwrite (in) */
- char *afd_extension; /* pointer to format extension string (out) */
- void *afd_inquire; /* format inquire routine address (out) */
- void *afd_decode; /* format decoder routine address (out) */
- void *afd_encode; /* format encoder routine address (out) */
- uint afd_colour; /* format highlight colour (out) */
- uint afd_id; /* format id (out) */
- uint afd_width; /* image width (in/out) */
- uint afd_height; /* image height (in/out) */
- void *afd_imageptr; /* 32bit imagebuffer pointer (in) */
- ulong afd_filesize; /* file size in bytes (in) */
- gp1k afd_filename; /* 1k filename string buffer (in) */
- gp1k afd_gpbuffer; /* 1k general purpose buffer (in) */
- };
-